package jdbc;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class Text2 {
    public static void main(String[] args) {
        try(
             Connection connection = DBUtil.getConnection();
        ) {
           Statement state = connection.createStatement();
           String sql = "DELETE FROM student1" +
                        "WHERE name NOT LIKE 'test_' "+
                        "AND name NOT LIKE 'test1_'";
           int count =state.executeUpdate(sql);
           if(count>0){
               System.out.println("影响了表中"+count+"条数据");
           }
            System.out.println("执行完毕");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
